package com.vincent.guava;

import java.util.Collection;

import javax.annotation.Nullable;

import org.testng.annotations.Test;

import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;

public class IterablesTester {

	@Test
	public void iterablesTester() {
		Collection<Object> addTo = null;
		Iterable<? extends Object> addFrom = null;

		Iterables.addAll(addTo, addFrom);

		Iterables.all(addFrom, new Predicate<Object>() {
			// is all apply to the predicate?
			@Override
			public boolean apply(@Nullable Object input) {
				// TODO Auto-generated method stub
				return false;
			}
		});

		Iterables.any(addFrom, new Predicate<Object>() {
			// is any apply to the predicate?
			@Override
			public boolean apply(@Nullable Object input) {
				// TODO Auto-generated method stub
				return false;
			}
		});
		Iterables.filter(addFrom, new Predicate<Object>() {
			// is any apply to the predicate?
			@Override
			public boolean apply(@Nullable Object input) {
				// TODO Auto-generated method stub
				return false;
			}
		});

		Iterables.contains(addFrom, new Object());

		Iterables.isEmpty(addFrom);

		Collection<?> elementsToRemove = null;
		Iterables.removeAll(addFrom, elementsToRemove);

		Iterables.removeIf(addFrom, new Predicate<Object>() {
			// remove if apply to the predicate
			@Override
			public boolean apply(@Nullable Object input) {
				// TODO Auto-generated method stub
				return false;
			}
		});

		Iterables.size(addFrom);

		Iterables.toArray(addFrom, Object.class);

		Iterable<? extends Object> unmodifiableIterable = Iterables
				.unmodifiableIterable(addFrom);

	}
}
